package com.wanxi.springboot.team.manage.system.mapper;

import com.wanxi.springboot.team.manage.system.model.Permission;
import com.wanxi.springboot.team.manage.system.model.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 蒋帆
 * @since 2020-12-21
 */
public interface RoleMapper extends BaseMapper<Role> {

    List<Role> getRoles(Integer page, Integer limit);

    long getRolesCount();

    int updateRole(Role role);

    int deleteRole(Integer id);

    long getUserCountByRole(Integer id);

    List<Permission> getRolePermissions(Integer id);

    Role getRoleByUserId(Integer userId);

    List<Role> getRoleList();
}
